import request from '@/utils/request'

export function getClients(params) {
  return request({
    url: `/clients`,
    params
  })
}

export function getClientsCount(params) {
  return request({
    url: `/clients/count`,
    params
  })
}

export function delClient(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}

export function addClient(data) {
  return request({
    url: `/clients`,
    method: 'post',
    data
  })
}

export function getClientDetail(id) {
  return request({
    url: `/clients/${id}`
  })
}

export function updateClient(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}
